
#import <AFNetworking/AFNetworking.h>

@class MsgModel;

typedef void(^ResultHttpBlock)(id Data,MsgModel *msgModel);
typedef void(^ResultHttpErrorBlock)(id response);

@interface HttpRequest : AFHTTPSessionManager <UIAlertViewDelegate>

+ (instancetype)currentHttpRequest;

- (void)postPath:(NSString *)path params:(id)params resultBlock:(ResultHttpBlock)resultBlock;

- (void)getPath:(NSString *)path params:(id)params resultBlock:(ResultHttpBlock)resultBlock;

- (void)putPath:(NSString *)path params:(id)params resultBlock:(ResultHttpBlock)resultBlock;

- (void)uploadWithParams:(id)params andImageData:(NSData*)data block:(void (^)(NSString *SamllPhoto))block;
//表单格式获取数据
+(void)formPostPath:(NSString *)myUrl
             params:(NSMutableDictionary *)dicData
        resultBlock:(ResultHttpBlock)resultBlock;

+(BOOL)httpPutDataWithUploadDate:(NSData *)uploadDate UserName:(NSString *)userName FilePath:(NSString *)filePath;
@end

@interface MsgModel : NSObject

@property (assign, nonatomic) NSInteger status;
@property (copy, nonatomic) NSString *message;
@property (copy, nonatomic) NSString *errorCode;
@property (assign, nonatomic) int Total;
@property (assign, nonatomic) BOOL noNetwork;
@property (nonatomic, assign) int changeCount;

@end
